function Lazyload(){}
$.extend(Lazyload.prototype,{
    init:function(){
        this.imglist = $(".floor_item");
        this.getAllimg();
        this.cHeight =document.documentElement.clientHeight;
        this.timre = null;
        $(window).on("scroll",$.proxy(function(){
           var flag = true ;
           if (!flag) return false;
           setTimeout($.proxy(function(){
                this.imgShow();
                // console.log(1);
                flag = false;
           },this),500)
        },this))
    },
    getAllimg :function(){
        $.each(this.imglist,$.proxy(function(index,img){
            var img = $(img).children(".pro_img").children("img");
           img.attr("data-top",img.offset().top);
        },this))
    },
    imgShow : function(){
        var scrollTop = $("body,html").scrollTop();
        $.each(this.imglist,$.proxy(function(index,img){
            var imgs = $(img).children(".pro_img").children("img");
            var img_top = imgs.attr("data-top");
            if(scrollTop+this.cHeight >= img_top){
                var src = imgs.parent().attr("data-img");
               imgs[0].src = src;
            }
        },this))
    }
})
export default new Lazyload();